<?php
if(isset($_FILES['file']) && isset($_POST['op'])){
    $openid=$_POST['op'];
    $fileName= basename($_FILES['file']['name']);
    $tmpName=explode('.', $fileName);
    $extension=$tmpName[count($tmpName)-1];
    $newName=$openid.'.'.$extension;
 
    $file='/var/www/chongya/upload/'.$newName;
    move_uploaded_file($_FILES['file']['tmp_name'], $file);
    
    echo 'ok';
    
}